.carousel-fit-contain {
    height: 100%;
}

.carousel-fit-contain > .carousel-inner {
    height: 100%;
}

.carousel-fit-contain .carousel-item {
    height: 100%;
}

.carousel-fit-contain .carousel-item > *:not(div.carousel-caption) {
    width: 100%;
    height: 100%;
    object-fit: contain;
}